package com.team11.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.team11.server.mapper.TInformationMapper;
import com.team11.server.pojo.KcInformation;
import com.team11.server.pojo.TInformation;
import com.team11.server.service.ITInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author pjc
 * @since 2021-06-12
 */
@Service
public class TInformationServiceImpl extends ServiceImpl<TInformationMapper, TInformation> implements ITInformationService {

    @Resource
    private TInformationMapper tInformationMapper;

    @Override
    public Map<String,Object>  getTeacherByTJobNumber(String tJobNumber) {

        Map<String,Object> map= tInformationMapper.getTeacherByTJobNumber(tJobNumber);
         return map;
    }

    /**
     * 获取所有老师
     * @return
     */
    @Override
    public Object getAllTeacher() {
        List<TInformation> items = tInformationMapper.selectList(null);// 获取了表中所有数据
        List<String> list = items.stream().map(TInformation::getTName).collect(Collectors.toList());
        return list;
    }
}
